package com.fluidops.datacatalog.reltables.schemascore;

import java.util.Set;

import com.fluidops.datacatalog.reltables.acsDB.ACSDB;

public class SchemaMaxScore implements ISchemaScore{

	private ConsistencyScore cs;
	
	public SchemaMaxScore(ACSDB acsDB){
		this.cs = new ConsistencyScore(acsDB);
	}
	
	@Override
	public double compareSchemas(Set<String> schema1, Set<String> schema2) {
		double consistency = 0d;
		
		double temp;
		for(String a : schema2){
			temp = this.cs.consistencyScore(schema1, a);
			consistency = consistency < temp ? temp : consistency;
		}
		
		return consistency;
	}

	@Override
	public ConsistencyScore getConsistencyScore() {
		return this.cs;
	}
}
